package com.ww.hegou.controller;

import com.ww.hegou.service.MoraService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

@RestController
@RequestMapping("music")
public class TestController {
    @Autowired
    MoraService moraService;

    @RequestMapping("info")
    public Map<String, Object> test1(HttpServletResponse response,String query) throws IOException {
        return moraService.getMoraInfo(query, response);
//        moraService.downloadMusic("13425613");

    }
    @RequestMapping("zip")
    public void test2(HttpServletResponse response,String query) throws IOException {

          moraService.getZip(response,query);
//        moraService.downloadMusic("13425613");

    }
}
